package goodenglish.domain.service;

import java.io.File;

/**
 * 字幕进入系统的途径
 * 
 * @author hp
 * 
 */
public enum SubtInType {
	IMPORT_SRC, IMPORT_TXT, REBACK;
	public static SubtInType getImportSubtInType(File file) {
		if (file.getName().endsWith(".txt")) {
			return SubtInType.IMPORT_TXT;
		}

		if (file.getName().endsWith(".srt")) {
			return SubtInType.IMPORT_SRC;
		}
		throw new RuntimeException("不支持的文件类型");
	}

	public static void main(String[] args) {
		SubtInType subtInType = SubtInType.IMPORT_TXT;
		System.out.println(subtInType);
	}
}
